package com.zhanglei.method;

/**
 * @author caesar
 * @date 2025/7/5
 * @apiNote
 */
public class ElectricScooter {
    private String scooterId;//滑板车唯一编号
    private String brand;//品牌名称
    private double batteryLevel;//当前电量百分比
    private boolean isAvailable;//是否可用
    public static int maxSpeed = 25;//所有滑板车的最高速度限制
    public ElectricScooter() {
    }

    public ElectricScooter(String scooterId, String brand, double batteryLevel, boolean isAvailable) {
        this.scooterId = scooterId;
        this.brand = brand;
        this.batteryLevel = batteryLevel;
        this.isAvailable = isAvailable;
    }

    public static int getMaxSpeed() {
        return maxSpeed;
    }

    public static void setMaxSpeed(int maxspeed) {
        ElectricScooter.maxSpeed = maxspeed;
    }

    public String getScooterId() {
        return scooterId;
    }

    public void setScooterId(String scooterId) {
        this.scooterId = scooterId;
    }

    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    public double getBatteryLevel() {
        return batteryLevel;
    }

    public void setBatteryLevel(double batteryLevel) {
        if(batteryLevel < 0 ){
            this.batteryLevel = 0;
        }else if(batteryLevel > 100){
            this.batteryLevel = 100;
        }
        this.batteryLevel = batteryLevel;
    }

    public boolean isAvailable() {
        return isAvailable;
    }
    public void setAvailable(boolean available) {
        isAvailable = available;
    }
}
